package cn.edu.scau.cmi.wujingxuan.Adapater;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.text.Text;
import javafx.stage.Stage;

public class AdapterClient extends Application
{
	@Override
	public void start(Stage stage)
	{

		// ������
		Adaptee adaptee = new Adaptee();
		Target target = new AdapterOfClass();
		Text T3 = new Text(150, 50, "AdapterOfClass:");
		Text T1 = new Text(250, 50, adaptee.adapteeRequest());
		Text T2 = new Text(250, 80, target.output5V());

		// ��������
		Adaptee adaptee1 = new Adaptee();
		Target target1 = new AdapterOfObject(adaptee1);
		Text T4 = new Text(140, 130, "AdapterOfObject:");
		Text T5 = new Text(250, 130, adaptee1.adapteeRequest());
		Text T6 = new Text(250, 160, target1.output5V());

		Pane pane = new Pane();
		pane.getChildren().addAll(T1, T2, T3);
		pane.getChildren().addAll(T4, T5, T6);
		Scene scene = new Scene(pane, 600, 400);
		stage.setScene(scene);
		stage.setTitle("Adapter");
		stage.show();

	}

	public static void main(String[] args)
	{
		Application.launch(args);
	}
}
